import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

class DoubleLInkedListSentinelTest {
    @Test
    public void test1() {
        DoubleLinkedListSentinel list = new DoubleLinkedListSentinel();
        list.addFirst(1);
        list.addFirst(2);
        list.addFirst(4);
        list.loop();
    }
    @Test
    public void test2() {
        DoubleLinkedListSentinel list = new DoubleLinkedListSentinel();
        list.addFirst(1);
        list.addFirst(2);
        list.addFirst(4);
        list.loop1(value->{
            System.out.println(value);
        });
    }

    @Test
    public void test3() {
        DoubleLinkedListSentinel list = new DoubleLinkedListSentinel();
        list.addFirst(1);
        list.addFirst(2);
        list.addFirst(4);
       for (Integer value : list) {
           System.out.println(value);
       }
    }

    @Test
    public void test4() {
        DoubleLinkedListSentinel list = new DoubleLinkedListSentinel();
        list.addLast(1);
        list.addLast(2);
        list.addLast(9);
        list.addLast(7);
        for (Integer value : list) {
            System.out.println(value);
        }


    }

    @Test
    public void test5() {
        DoubleLinkedListSentinel list = new DoubleLinkedListSentinel();
        list.addLast(2);
        list.addLast(4);
        list.addLast(6);
        list.addLast(9);
        int value = list.get(2);
        System.out.println(value);
    }

    @Test
    @DisplayName("测试insert")
    public void test6() {
        DoubleLinkedListSentinel list = new DoubleLinkedListSentinel();
        list.addLast(2);
        list.addLast(4);
        list.addLast(6);
        list.addLast(9);
        list.insert(0, 10);

        list.loop();
    }


}